home *** CD-ROM | disk | FTP | other *** search
/ MacAddict 125 / MacAddict_125_2007_01.iso / Software / Interface / sqreensavers 1.0.dmg / plasq sqreensavers.pkg / Contents / Resources / postflight < prev    next >
Text File  |  2006-08-02  |  1KB  |  58 lines

  1. #!/bin/sh
  2.  
  3. # The plasq screen savers have been written to the root directory and need to
  4. # be moved to either:
  5. #   "/Library/Screen Savers" or 
  6. #   "~/Library/Screen Savers".
  7.  
  8.  
  9. # The text file here knows where to write the files based upon the user's
  10. # selection in the installer.
  11. destdir=`cat /tmp/plasqscreensaverdestination.txt`
  12.  
  13. if [ "$destdir" != "" ]
  14. then
  15.     if [ ! -d "$destdir" ]
  16.     then
  17.         # create the screen savers directory if it doesn't already exist.
  18.         echo Creating \""$destdir"\" directory
  19.         mkdir "$destdir"
  20.  
  21.         if [ `echo $destdir | cut -c1-8` = "/Library" ]
  22.         then
  23.             # common dir
  24.             chmod 775 "$destdir"
  25.         else
  26.             # user dir
  27.             chown $USER "$destdir"
  28.             chmod 755 "$destdir"
  29.         fi
  30.     fi
  31.  
  32.     ls -d /plasq*.saver | while read file
  33.     do
  34.         if [ "$file" != "" ]
  35.         then
  36.             fullpath=$destdir$file
  37.             rm -fr "$fullpath"
  38.             mv -f "$file" "$fullpath"
  39.             echo Moving \""$file"\" to \""$fullpath"\"
  40.  
  41.             if [ `echo $destdir | cut -c1-8` = "/Library" ]
  42.             then
  43.                 # common dir
  44.                 chmod -R 775 "$fullpath"
  45.             else
  46.                 # user file - group is same as user name
  47.                 chown -R $USER:$USER "$fullpath"
  48.                 chmod -R 755 "$fullpath"
  49.             fi
  50.         fi
  51.     done
  52. fi
  53.  
  54. # cleanup
  55. rm -rf /plasq*.saver
  56. rm -f /tmp/plasqscreensaverdestination.txt
  57.  
  58.